/**
 * ChooseIcon.java
 *
 * Created on Mar 31, 2010, 7:52:45 PM
 * 
 * @author Beatrice Bacelli
 * @author Luca Bedogni
 * @author Silvia Righini
 */

package unibo.lsb.test;

import java.awt.Component;

import javax.swing.JList;

public class ChooseIcon extends javax.swing.JDialog {

	/** Creates new form ChooseIcon */
	public ChooseIcon(java.awt.Frame parent, boolean modal) {
		super(parent, modal);
		initComponents();
	}

	/**
	 * Initialization
	 */
	private void initComponents() {
		jTable1 = new javax.swing.JTable();

		setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

		jTable1.setBorder(javax.swing.BorderFactory
				.createLineBorder(new java.awt.Color(0, 0, 0)));
		jTable1.setModel(new javax.swing.table.DefaultTableModel(
				new Object[][] { { null, null, null, null },
						{ null, null, null, null }, { null, null, null, null },
						{ null, null, null, null }, { null, null, null, null },
						{ null, null, null, null } }, new String[] { "Title 1",
						"Title 2", "Title 3", "Title 4" }) {
			boolean[] canEdit = new boolean[] { false, false, false, false };

			@Override
			public boolean isCellEditable(int rowIndex, int columnIndex) {
				return canEdit[columnIndex];
			}
		});

		javax.swing.GroupLayout layout = new javax.swing.GroupLayout(
				getContentPane());
		getContentPane().setLayout(layout);
		layout.setHorizontalGroup(layout.createParallelGroup(
				javax.swing.GroupLayout.Alignment.LEADING).addGroup(
				javax.swing.GroupLayout.Alignment.TRAILING,
				layout.createSequentialGroup().addContainerGap(23,
						Short.MAX_VALUE).addComponent(jTable1,
						javax.swing.GroupLayout.PREFERRED_SIZE, 356,
						javax.swing.GroupLayout.PREFERRED_SIZE).addGap(21, 21,
						21)));
		layout.setVerticalGroup(layout.createParallelGroup(
				javax.swing.GroupLayout.Alignment.LEADING).addGroup(
				layout.createSequentialGroup().addGap(25, 25, 25).addComponent(
						jTable1, javax.swing.GroupLayout.PREFERRED_SIZE,
						javax.swing.GroupLayout.DEFAULT_SIZE,
						javax.swing.GroupLayout.PREFERRED_SIZE)
						.addContainerGap(179, Short.MAX_VALUE)));

		pack();
	}// </editor-fold>//GEN-END:initComponents

	/**
	 * @param args
	 *            the command line arguments
	 */
	public static void main(String args[]) {
		java.awt.EventQueue.invokeLater(new Runnable() {
			public void run() {
				ChooseIcon dialog = new ChooseIcon(new javax.swing.JFrame(),
						true);
				dialog.addWindowListener(new java.awt.event.WindowAdapter() {
					@Override
					public void windowClosing(java.awt.event.WindowEvent e) {
						System.exit(0);
					}
				});
				dialog.setVisible(true);
			}
		});
	}

	public Component getCellRendererComponent(JList jlist, Object value,
			int index, boolean isSelected, boolean cellHasFocus) {
		// if(isSelected) jpanel.setBackground(selColor);
		// else jpanel.setBackground(normColor);
		// // border
		// if(cellHasFocus) jpanel.setBorder(selBorder);
		// else jpanel.setBorder(normBorder);
		// // set the image eith text
		// ImageDescription id = (ImageDescription)value;
		// image.setIcon(id.imageIcon_scaled);
		// text.setText(id.name + " (" + id.imageIcon.getIconWidth() + "x" +
		// id.imageIcon.getIconHeight() + " Pixel)");
		//
		// return jpanel;
		return null;
	}

	// Variables declaration - do not modify//GEN-BEGIN:variables
	private javax.swing.JTable jTable1;
	// End of variables declaration//GEN-END:variables

}
